package com.mujin.keji.collectionsystem.module.protectionrules.adapter;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.mujin.keji.collectionsystem.R;
import com.mujin.keji.collectionsystem.db.domain.VisitRuleBean;

import java.util.List;


public class VisitRuleAdapter extends RecyclerView.Adapter<VisitRuleAdapter.ViewHolder> {
    private Activity mContext;
    private List<VisitRuleBean> datas;


    public VisitRuleAdapter(Activity context, List<VisitRuleBean> datas) {
        mContext = context;
        this.datas = datas;

    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.activity_citylist, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, final int position) {
//        holder.tvName.setText(datas.get(position).getName());
//
//        holder.tvPhone.setText(datas.get(position).getPhone());

    }

    @Override
    public int getItemCount() {
        return datas == null ? 0 : datas.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        private TextView tvName;
        private TextView tvPhone;


        public ViewHolder(final View itemView) {
            super(itemView);
            tvName = (TextView) itemView.findViewById(R.id.tv_name);
            tvPhone = (TextView) itemView.findViewById(R.id.tv_phone);
        }

    }
}
